package com.lsh.oms.core.model.order;

import com.lsh.oms.core.enums.ShippingStatus;
import com.lsh.oms.core.model.base.VenderModel;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * @author peter
 */
@Data
@NoArgsConstructor
public class OrderShippingHead extends VenderModel implements Serializable{
    /**
	 * 
	 */
	private static final long serialVersionUID = 9157304751497182308L;

	private Long id;

    private Long shippingOrderId;

    private Long addressId;

    private String addressInfo;

    private String province;

    private String city;

    private String county;

    private String area;

    private String warehouseId;

    private String warehouseName;

    private Long orderId;

    private Integer status;

    private BigDecimal skuCount;

    private BigDecimal realSkuCount;

    private BigDecimal money;

    private BigDecimal floorMoney;

    private BigDecimal couponMoney;

    private Integer activedAt;

    private Integer shippedAt;

    private Integer arrivedAt;

    private Integer createdAt;

    private Integer updatedAt;

    private Long transUid;

    private String waybillNo;

    private Integer receiptStatus;

    private Integer delayType;

    private Integer zoneId;

    private Integer storageTypeId;

    private Long tmsOrderId;

    private Integer orderFrom;
    /**
     * 车辆类型
     */
    private String carType;

    /**
     * 周转箱数
     */
    private Integer turnoverboxNum;
    /**
     * 整箱数
     */
    private Integer boxNum;
    /**
     * 订单优先级
     */
    private Integer seq;
    /**
     * 是否优先配送
     */
    private Integer isPrecedence;

    private Integer orderedAt;

    private Long uid;

    private Integer isValid;

    private String omsExt;

    private Long tmsId;

    private String waybillId;

    private Integer afsFlag;

    private String providerId;

    // TODO 2019-12-24 peter

    private Integer lackFlag;

    private Long routeId;

    private Long fOrderId;

    private List<OrderShippingDetail> details;

    public boolean goWithoutTms() {
        return tmsId == 0L;
    }

    public boolean delivering() {
        return (status != null) && (status.equals(ShippingStatus.DELIVERING.getIndex()) || status.equals(ShippingStatus.WAIT_DELIVER.getIndex()));
    }
}